//
//  FillJiuCollectionViewCell.m
//  简单豆瓣不得不交版 1 带
//
//  Created by dllo on 16/6/24.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "FillJiuCollectionViewCell.h"
#import "FilmModel.h"
#import "UIImageView+WebCache.h"

@implementation FillJiuCollectionViewCell


- (void)dealloc
{
    
    [_FillImageView release];
    [_FillLabel release];
    [super dealloc];
}


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatImage];
        [self creatLabel];
    }
    return self;
}


- (void) creatImage {
    
    self.FillImageView = [[UIImageView alloc] init];
  //  self.FillImageView.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:self.FillImageView];
    [_FillImageView release];

}

- (void) creatLabel {
    
    self.FillLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.FillLabel];
    [_FillLabel release];
    
    
    
}

- (void)layoutSubviews{
    [super layoutSubviews];
    
    self.FillImageView.frame = CGRectMake(0, 0, 120, 150);
    self.FillLabel.frame =  CGRectMake(0, 150, 120, 30);
    
}

- (void)setModel:(FilmModel *)model{
    
    if (_model != model) {
        [_model release];
        _model = [model retain];
        
    }
    
    NSURL *url = [NSURL URLWithString:model.pic_url];
    [self.FillImageView sd_setImageWithURL:url];
    
    self.FillLabel.text = model.movieName;
    
}




@end
